# sifus

CXX = g++
CXXFLAGS = -W -Wall -O3 -fomit-frame-pointer -funroll-loops -finline-functions -ffast-math -I /usr/include/libcfitsio0/ \
	   `root-config --cflags`
LDFLAGS = -L/usr/local/lib -L/usr/local/root/lib -lCore -lMinuit -pthread -lm -ldl -lcfitsio 

OBJECTS = IFUException.o FITSException.o IFUConf.o IFUMap.o ImageSlice.o Image.o \
	  ASCIIImage.o FITSImage.o GaussParameters.o Mask.o NonLinear.o NonLinearFit.o Sifus.o \
	  main.o

# compila com debug symbols se DEBUG estiver setado
ifeq ($(DEBUG),1)
	DBG = -g2 -ggdb
	CXXFLAGS = -W -Wall `root-config --cflags`
else
	DBG =
endif

ifeq ($(PROFILE),1)
	DBG = -g2 -ggdb -pg
	CXXFLAGS = -W -Wall `root-config --cflags`
	LDFLAGS += -pg
endif

# regras

all: sifus

sifus: $(OBJECTS)
	$(CXX) $(LDFLAGS) -o $@ $^

%.o: %.cxx
	$(CXX) $(CXXFLAGS) $(DBG) -c -o $@ $<

clean:
	-@ rm -f *.o sifus TAGS

tags:
	-@ etags *.{cxx,h} --declarations --members
